<!--
@author: mucd
@date: 2022/6/28 10:12
-->
<template>
  <div>
    <el-form>
      <el-form-item>
        <el-input v-model="searchText"></el-input>
        <el-button @click="search()" type="success">搜索</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "BlogHomeSearch",
  data() {
    return {
      searchText: '',
    }
  },
  methods: {
    /**
     * 点击搜索
     */
    search() {
      this.$router.push('/blogSearch')
      this.$homeReq.searchArticleSearchArticleByTitleByContent(this.searchText, 1, 15).then(data => {
        this.$emit("searchData", data);
      })
    },
  },


  created() {
    console.log('搜索组件 ing ...')
  }
}
</script>

<style scoped>

</style>
